﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WMP
{
    class PlayLists_OUTDATED
    {
        public enum Type
        {
            MP3 = 0, MPG = 1, UNKNOWN = 2, EOL = 42
        };

        public struct Item
        {
            public string name;
            public Type type;
        };

        private List<Item> list = new List<Item>();
        private int pos = 0;

        public void addItem(string name, Type type)
        {
            Item item;
            if (list.Count <= 0)
            {
                item = new Item();
                item.name = "NONAME";
                item.type = PlayLists_OUTDATED.Type.EOL;
                list.Add(item);
            }
            item = new Item();
            item.name = name;
            item.type = type;
            list.Add(item);
        }

        public PlayLists_OUTDATED.Item getItem()
        {
            if (pos < list.Count)
                return (list[pos]);
            else
                return (list[0]);
        }

        public PlayLists_OUTDATED.Item getNextItem()
        {
            pos += 1;
            if (pos < list.Count)
                return (list[pos]);
            else
                return (list[0]);
        }

        public PlayLists_OUTDATED.Item getPrevItem()
        {
            if (pos > 0)
                pos -= 1;
            return (list[pos]);
        }

        public PlayLists_OUTDATED.Item getItem(int pos)
        {
            if (pos > list.Count)
                return (list[list.Count]);
            else
                return (list[pos]);
        }
    }
}
